<?php if(User::is_authenticated() && (User::is_authenticated() == $image->User_id || User::is_admin())): ?>
<div id="delete_popup" class="popup">
	<p class="title"><?php echo lang('image_deletion'); ?><a class="close"><?php echo lang('close_popup'); ?></a></p>
	<div class="clear"><!-- --></div>
	<p class="info"><?php echo lang('delete_confirm', array('title'=>$image->title())); ?></p>
	<form method="POST" action="">
		<p>
			<input type="submit" class="button enabled" name="delete" value="Delete"/>
		</p>
	</form>
</div>
<?php endif; ?>
<div id="content" class="view">
	<div id="title">
		<p class="title"><?php echo $image->title(); ?></p>
		<p>
			<?php echo lang('image_submitted', array('date'=>$image->submitted(), 'user'=>$image->uploader())); ?>
			<?php if(User::is_authenticated() && (User::is_authenticated() == $image->User_id || User::is_admin())): ?>
			<span class="right normal"><a href="javascript: void(0);" id="delete_button">delete</a></span>
			<?php endif; ?>
		</p>
	</div>
	<div id="information">
		<?php if($total > 1): ?>
		<div id="slider">
			<p id="index"><?php echo lang('image_index', array('index'=>$index + 1, 'total'=>'<span id="total">'.$total.'</span>')); ?></p>
			<div id="slides">
				<a id="slide_left"<?php if($total <= 5): ?> style="visibility: hidden;"<?php endif; ?>>&lsaquo;</a>
				<div id="images">
					<?php $i = 0; foreach($galleries as $gallery): ?>
					<?php while($icon = $gallery->fetch()): ?>
					<a href="<?php echo PATH.$icon->alpha(); ?>/" class="image<?php if(++$i == 5): ?> right<?php endif; ?><?php if($icon->id == $image->id): ?> current<?php endif; ?>">
						<div><?php $icon->output('icon'); ?></div>
					</a>
					<?php endwhile; ?>
					<?php endforeach; ?>
				</div>
				<a id="slide_right"<?php if($total <= 5): ?> style="visibility: hidden;"<?php endif; ?>>&rsaquo;</a>
			</div>
			<div class="clear"><!-- --></div>
		</div>
		<?php else: ?>
		<div id="empty_slider"><!-- --></div>
		<?php endif; ?>
		<?php if($image->description): ?>
		<p class="title"><?php echo lang('description'); ?></p>
		<p><?php echo $image->description; ?></p>
		<?php endif; ?>
		<p class="title"><?php echo lang('statistics'); ?></p>
		<p class="info"><?php echo lang('image_statistics', array('views'=>$image->views, 'bandwidth'=>size($image->views*$image->size))); ?></p>
		<p class="link">
			<?php echo lang('image'); ?>
			<input type="text" value="<?php echo $http.$alpha; ?>" readonly="readonly"/>
		</p>
		<p class="link">
			<?php echo lang('html'); ?>
			<input type="text" value="&lt;img src=&quot;<?php echo $http.$alpha.'.'.$image->extension; ?>&quot; alt=&quot;<?php echo $image->title(); ?>&quot;/&gt;" readonly="readonly"/>
		</p>
		<p class="link">
			<?php echo lang('bbcode'); ?>
			<input type="text" value="[img]<?php echo $http.$alpha.'.'.$image->extension; ?>[/img]" readonly="readonly"/>
		</p>
		<p class="title">
			<!-- AddThis Button BEGIN -->
			<div class="addthis_toolbox addthis_default_style ">
			<a class="addthis_button_preferred_1"></a>
			<a class="addthis_button_preferred_2"></a>
			<a class="addthis_button_preferred_3"></a>
			<a class="addthis_button_compact"></a>
			<a class="addthis_counter addthis_bubble_style"></a>
			</div>
			<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4f2ff4ce07f0b85e"></script>
			<!-- AddThis Button END -->
		</p>
	</div>
	<a id="image" href="<?php echo WEB.$alpha.'.'.$image->extension; ?>">
		<?php $image->output('medium'); ?>
	</a>
	<div class="clear"><!-- --></div>
</div>